(function(){

	SimulaForm = function(){
		var formElement;
		var values = [];

		this.setFormElem = function(form){
			formElement = form;
			$(formElement).submit(this.getValues);
		}

		this.hide = function(){
			formElement.setAttribute('class', 'hidden');
		};

		this.show = function(){
			formElement.setAttribute('class', '');
		};

		this.getValues = function(){
			var inputs = $('#settings li input');

			values = [];
			for(var i = 0; i < inputs.length; i++){
				values.push($(inputs[i]).val());
			}

			console.log(values);
			var val = values;
			engine.setValues(val[0],val[1],val[2],val[3],val[4],val[5],val[6]);
			engine.calculate();
			
			formObj.hide();
			formObj.callbackProp();

			return false;
		};

	}

})();

formObj = new SimulaForm();
formObj.setFormElem(document.getElementById('settings'));
formObj.hide();
